﻿@model DistributeTransaction.Models.Order

@{
    ViewBag.Title = "Edit Shipping Address";
}

<h2>@ViewBag.Title</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("EditShip","ShoppingCart"))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Shipping Address</legend>

        @Html.HiddenFor(model => model.OrderID)

        <div class="editor-label">
            @Html.LabelFor(model => model.ShipName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ShipName)
            @Html.ValidationMessageFor(model => model.ShipName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ShipAddress)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ShipAddress)
            @Html.ValidationMessageFor(model => model.ShipAddress)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ShipCity)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ShipCity)
            @Html.ValidationMessageFor(model => model.ShipCity)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ShipPostalCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ShipPostalCode)
            @Html.ValidationMessageFor(model => model.ShipPostalCode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ShipCountry)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ShipCountry)
            @Html.ValidationMessageFor(model => model.ShipCountry)
        </div>
        <p>@Html.Hidden("Amount", ViewBag.Amount as string)</p>
        <div>
            <input type="submit" name="command" id="Continue" value="Place Order" />
            <input type="submit" name="command" id="Cancel" value="Cancel" />
        </div>
    </fieldset>
}
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $('#ShipName').focus();
        $('#ShipCountry').focus();
        $('#ShipPostalCode').focus();
        $('#ShipCity').focus();
        $('#ShipAddress').focus();
        $('#ShipName').focus();
    });
</script>